﻿using Admin.NET.Core;
using Furion.DatabaseAccessor;
using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Admin.NET.Application
{
    /// <summary>
    /// 巡检车管理
    /// </summary>    
    [Route("api/carmanager")]
    [ApiDescriptionSettings("道路巡检", Name = "CarManager", Order = 100)]
    [AllowAnonymous]
    public class CarService : IDynamicApiController,ICarService, IScoped
    {
        /// <summary>
        /// 获取巡检车
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public async Task<object> GetCarList()
        {
            List<CarListDto> list = Db.GetRepository<CarInfo>().AsQueryable().Adapt<List<CarListDto>>();
            return list;
        }
    }
}
